package org.jivesoftware.smackx.packet;

import org.jivesoftware.smack.packet.PacketExtension;

public class MUCUser
  implements PacketExtension
{
  private Invite invite;
  private Decline decline;
  private Apply apply;
  private Accept accept;
  private Item item;
  private String password;
  private Status status;
  private Destroy destroy;

  public String getElementName()
  {
    return "x";
  }

  public String getNamespace()
  {
    return "http://jabber.org/protocol/muc#user";
  }

  public String toXML()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append("\">");
    if (getInvite() != null)
      localStringBuilder.append(getInvite().toXML());
    if (getDecline() != null)
      localStringBuilder.append(getDecline().toXML());
    if (getApply() != null)
      localStringBuilder.append(getApply().toXML());
    if (getAccept() != null)
      localStringBuilder.append(getAccept().toXML());
    if (getItem() != null)
      localStringBuilder.append(getItem().toXML());
    if (getPassword() != null)
      localStringBuilder.append("<password>").append(getPassword()).append("</password>");
    if (getStatus() != null)
      localStringBuilder.append(getStatus().toXML());
    if (getDestroy() != null)
      localStringBuilder.append(getDestroy().toXML());
    localStringBuilder.append("</").append(getElementName()).append(">");
    return localStringBuilder.toString();
  }

  public Invite getInvite()
  {
    return this.invite;
  }

  public Apply getApply()
  {
    return this.apply;
  }

  public Decline getDecline()
  {
    return this.decline;
  }

  public Item getItem()
  {
    return this.item;
  }

  public String getPassword()
  {
    return this.password;
  }

  public Status getStatus()
  {
    return this.status;
  }

  public Destroy getDestroy()
  {
    return this.destroy;
  }

  public void setInvite(Invite paramInvite)
  {
    this.invite = paramInvite;
  }

  public void setApply(Apply paramApply)
  {
    this.apply = paramApply;
  }

  public Accept getAccept()
  {
    return this.accept;
  }

  public void setAccept(Accept paramAccept)
  {
    this.accept = paramAccept;
  }

  public void setDecline(Decline paramDecline)
  {
    this.decline = paramDecline;
  }

  public void setItem(Item paramItem)
  {
    this.item = paramItem;
  }

  public void setPassword(String paramString)
  {
    this.password = paramString;
  }

  public void setStatus(Status paramStatus)
  {
    this.status = paramStatus;
  }

  public void setDestroy(Destroy paramDestroy)
  {
    this.destroy = paramDestroy;
  }

  public static class Accept
  {
    private String reason;
    private String from;
    private String to;
    private String fromNick;

    public String getFrom()
    {
      return this.from;
    }

    public String getReason()
    {
      return this.reason;
    }

    public String getTo()
    {
      return this.to;
    }

    public void setFrom(String paramString)
    {
      this.from = paramString;
    }

    public void setReason(String paramString)
    {
      this.reason = paramString;
    }

    public void setTo(String paramString)
    {
      this.to = paramString;
    }

    public String getFromNick()
    {
      return this.fromNick;
    }

    public void setFromNick(String paramString)
    {
      this.fromNick = paramString;
    }

    public String toXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<accept ");
      if (getTo() != null)
        localStringBuilder.append(" to=\"").append(getTo()).append("\"");
      if (getFrom() != null)
        localStringBuilder.append(" from=\"").append(getFrom()).append("\"");
      if (getFromNick() != null)
        localStringBuilder.append(" fromNick=\"").append(getFromNick()).append("\"");
      localStringBuilder.append(">");
      if (getReason() != null)
        localStringBuilder.append("<reason>").append(getReason()).append("</reason>");
      localStringBuilder.append("</accept>");
      return localStringBuilder.toString();
    }
  }

  public static class Apply
  {
    private String reason;
    private String from;
    private String to;
    private String toNick;

    public String getFrom()
    {
      return this.from;
    }

    public String getReason()
    {
      return this.reason;
    }

    public String getTo()
    {
      return this.to;
    }

    public void setFrom(String paramString)
    {
      this.from = paramString;
    }

    public void setReason(String paramString)
    {
      this.reason = paramString;
    }

    public void setTo(String paramString)
    {
      this.to = paramString;
    }

    public String getToNick()
    {
      return this.toNick;
    }

    public void setToNick(String paramString)
    {
      this.toNick = paramString;
    }

    public String toXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<apply ");
      if (getTo() != null)
        localStringBuilder.append(" to=\"").append(getTo()).append("\"");
      if (getFrom() != null)
        localStringBuilder.append(" from=\"").append(getFrom()).append("\"");
      if (getToNick() != null)
        localStringBuilder.append(" toNick=\"").append(getToNick()).append("\"");
      localStringBuilder.append(">");
      if (getReason() != null)
        localStringBuilder.append("<reason>").append(getReason()).append("</reason>");
      localStringBuilder.append("</apply>");
      return localStringBuilder.toString();
    }
  }

  public static class Decline
  {
    private String reason;
    private String from;
    private String to;
    private String fromNick;
    private MUCUser.MucType type;

    public String getFrom()
    {
      return this.from;
    }

    public String getReason()
    {
      return this.reason;
    }

    public String getTo()
    {
      return this.to;
    }

    public void setFrom(String paramString)
    {
      this.from = paramString;
    }

    public void setReason(String paramString)
    {
      this.reason = paramString;
    }

    public void setTo(String paramString)
    {
      this.to = paramString;
    }

    public String getFromNick()
    {
      return this.fromNick;
    }

    public void setFromNick(String paramString)
    {
      this.fromNick = paramString;
    }

    public MUCUser.MucType getType()
    {
      return this.type;
    }

    public void setType(MUCUser.MucType paramMucType)
    {
      this.type = paramMucType;
    }

    public String toXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<decline ");
      if (getTo() != null)
        localStringBuilder.append(" to=\"").append(getTo()).append("\"");
      if (getFrom() != null)
        localStringBuilder.append(" from=\"").append(getFrom()).append("\"");
      if (getFromNick() != null)
        localStringBuilder.append(" fromNick=\"").append(getFromNick()).append("\"");
      if (getType() != null)
        localStringBuilder.append(" type=\"").append(getType().toString()).append("\"");
      localStringBuilder.append(">");
      if (getReason() != null)
        localStringBuilder.append("<reason>").append(getReason()).append("</reason>");
      localStringBuilder.append("</decline>");
      return localStringBuilder.toString();
    }
  }

  public static class Destroy
  {
    private String reason;
    private String jid;

    public String getJid()
    {
      return this.jid;
    }

    public String getReason()
    {
      return this.reason;
    }

    public void setJid(String paramString)
    {
      this.jid = paramString;
    }

    public void setReason(String paramString)
    {
      this.reason = paramString;
    }

    public String toXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<destroy");
      if (getJid() != null)
        localStringBuilder.append(" jid=\"").append(getJid()).append("\"");
      if (getReason() == null)
      {
        localStringBuilder.append("/>");
      }
      else
      {
        localStringBuilder.append(">");
        if (getReason() != null)
          localStringBuilder.append("<reason>").append(getReason()).append("</reason>");
        localStringBuilder.append("</destroy>");
      }
      return localStringBuilder.toString();
    }
  }

  public static class Invite
  {
    private String reason;
    private String from;
    private String to;

    public String getFrom()
    {
      return this.from;
    }

    public String getReason()
    {
      return this.reason;
    }

    public String getTo()
    {
      return this.to;
    }

    public void setFrom(String paramString)
    {
      this.from = paramString;
    }

    public void setReason(String paramString)
    {
      this.reason = paramString;
    }

    public void setTo(String paramString)
    {
      this.to = paramString;
    }

    public String toXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<invite ");
      if (getTo() != null)
        localStringBuilder.append(" to=\"").append(getTo()).append("\"");
      if (getFrom() != null)
        localStringBuilder.append(" from=\"").append(getFrom()).append("\"");
      localStringBuilder.append(">");
      if (getReason() != null)
        localStringBuilder.append("<reason>").append(getReason()).append("</reason>");
      localStringBuilder.append("</invite>");
      return localStringBuilder.toString();
    }
  }

  public static class Item
  {
    private String actor;
    private String reason;
    private String affiliation;
    private String jid;
    private String nick;
    private String role;

    public Item(String paramString1, String paramString2)
    {
      this.affiliation = paramString1;
      this.role = paramString2;
    }

    public String getActor()
    {
      return this.actor == null ? "" : this.actor;
    }

    public String getReason()
    {
      return this.reason == null ? "" : this.reason;
    }

    public String getAffiliation()
    {
      return this.affiliation;
    }

    public String getJid()
    {
      return this.jid;
    }

    public String getNick()
    {
      return this.nick;
    }

    public String getRole()
    {
      return this.role;
    }

    public void setActor(String paramString)
    {
      this.actor = paramString;
    }

    public void setReason(String paramString)
    {
      this.reason = paramString;
    }

    public void setJid(String paramString)
    {
      this.jid = paramString;
    }

    public void setNick(String paramString)
    {
      this.nick = paramString;
    }

    public String toXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<item");
      if (getAffiliation() != null)
        localStringBuilder.append(" affiliation=\"").append(getAffiliation()).append("\"");
      if (getJid() != null)
        localStringBuilder.append(" jid=\"").append(getJid()).append("\"");
      if (getNick() != null)
        localStringBuilder.append(" nick=\"").append(getNick()).append("\"");
      if (getRole() != null)
        localStringBuilder.append(" role=\"").append(getRole()).append("\"");
      if ((getReason() == null) && (getActor() == null))
      {
        localStringBuilder.append("/>");
      }
      else
      {
        localStringBuilder.append(">");
        if (getReason() != null)
          localStringBuilder.append("<reason>").append(getReason()).append("</reason>");
        if (getActor() != null)
          localStringBuilder.append("<actor jid=\"").append(getActor()).append("\"/>");
        localStringBuilder.append("</item>");
      }
      return localStringBuilder.toString();
    }
  }

  public static enum MucType
  {
    Invite, Apply;
  }

  public static class Status
  {
    private String code;

    public Status(String paramString)
    {
      this.code = paramString;
    }

    public String getCode()
    {
      return this.code;
    }

    public String toXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<status code=\"").append(getCode()).append("\"/>");
      return localStringBuilder.toString();
    }
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smackx.packet.MUCUser
 * JD-Core Version:    0.6.1
 */